#include<bits/stdc++.h>
using namespace std;

struct node{
	double t = 0, index = 0;
}a[10000];

int main(){
	int n;
	cin>>n;
	for(int i = 1;i <= n;i++){
		cin>>a[i].t;
		a[i].index = i;
	}
	
	sort(a+1, a+n+1, [](node x, node y){
		return x.t < y.t;
	});

	double ans = 0, t = 0;
	for(int i = 1;i <= n;i++){
		t += a[i-1].t;
		ans += t;
		cout<<a[i].index<<" ";
	}
	cout<<endl<<fixed<<setprecision(2)<<ans/n;
	return 0;
}
